/**
 * 协同H5处理js
 * @author xuqw
 * @since V5-A8 6.1
 */

/**
 * 初始化处理页面
 */
function __initDeal__(callback){
    
    if (!summaryBO["summary"].finished){
        //指定回退中间节点
        if(summaryBO["summary"].affairState == 3 
            && summaryBO["summary"].affairSubState == 17 ) {
        
            summaryBO.pageConfig.canDeal = false;
        }
    }else {
        //流程结束，非知会打开
        if(!(summaryBO["currentPolicy"].id  == 'zhihui' 
            && summaryBO["summary"].listType == 'listPending')){
            summaryBO.pageConfig.canDeal = false;
        }
    }
    
    //加锁处理
    _lockForm(function(lockRet){
        _initDealDom(lockRet);
        callback && callback();
    });
    
  //添加缓存
    document.addEventListener('beforepageredirect', function(e){ 
        if(!pageX.isMoreComment){
            window.summaryBO.signatureId = window.signatureId;
            window.summaryBO.isLightForm = pageX.cache.isLightForm;
        }
        cmp.storage.save(CollCacheKey.summary.summaryBO + pageX.winParams.cache_subfix, cmp.toJSON(window.summaryBO), true);
    });
    
    document.addEventListener('deletesessioncache', function(e){
        //批量删除这类的全部数据
        CollCacheKey.delCacheKeys(CollCacheKey.summary, pageX.winParams.cache_subfix);
    });
}


/**
 * 表单加锁
 */
function _lockForm(callback){
    
    if(typeof summaryBO.formIsLock == "undefined"){
        
      //目前不支持新闻审批、公告审批。所以可以不加锁
        if (summaryBO["summary"].bodyType == '20' 
                && summaryBO.pageConfig.canDeal) {
            
            lockCollForm(function(ret) {
                
                //增加属性，表明表单锁
                summaryBO.formIsLock = !ret;
                callback && callback(ret);
            });
        }else{
            summaryBO.formIsLock = false;
            callback && callback(true);
        }
    }else{
        if(summaryBO.formIsLock && summaryBO.formLockMsg){
            _alert(summaryBO.formLockMsg);
            delete summaryBO.formLockMsg;//清空消息
        }
        callback && callback(!summaryBO.formIsLock);
    }
}

//协同表单上锁
function lockCollForm(callback) {
    var collObj = {
            "formAppId" : summaryBO["summary"].formAppId,
            "formRecordId" : summaryBO["summary"].formRecordId,
            "rightId" : summaryBO["summary"].rightId,
            "affairId" : summaryBO["summary"].affairId,
            "affairState" : summaryBO["summary"].affairState,
            "nodePolicy" : summaryBO["summary"].nodePolicy,
            "affairReadOnly" : summaryBO["summary"].affairReadOnly
        };
    
    $s.Coll.lockCollForm({}, collObj, errorBuilder({
        success : function(result) {
            var ret = true;
            if(result && result.canSubmit=="0") {
                _alert(cmp.i18n("collaboration.common.flag.editingForm", [result.loginName, result.from]));
                ret = false;
            }
            callback(ret);
        }
    }));
}

/**
 * 处理按钮相关DOM操作
 */
function _initDealDom(lockRet){
    
    if(summaryBO["summary"].listType != "onlyView" && !summaryBO["isHistory"]) {
        var ps = summaryBO.pageConfig.nodeActions;
        
        if(!summaryBO["summary"].finished) {
            if(!lockRet){
                if(CollUtils.isInArray(ps, "Forward")){
                    _showDealBtns(summaryBO.pageConfig.canDeal && summaryBO.formIsLock !== true, ["Forward"]);
                }
            }else{
                _showDealBtns(summaryBO.pageConfig.canDeal && summaryBO.formIsLock !== true, ps);
            }
        } else {
            var isInfoDeal = false;
            if(!(summaryBO["currentPolicy"].id  == 'zhihui' && summaryBO["summary"].listType == 'listPending')){
                summaryBO.pageConfig.canDeal = false;
            }else{
                //知会的时候
                if(summaryBO["summary"].affairState == 3){
                    isInfoDeal = true;
                }
            }

            if(CollUtils.isInArray(ps, "Forward") || isInfoDeal){
                _showDealBtns(summaryBO.pageConfig.canDeal && summaryBO.formIsLock !== true, ["Forward"]);
            }
			
            //已办增加收藏  (流程结束的已办)  or 流程结束已发
            if(summaryBO.pageConfig.canFavorite || summaryBO.openFrom == 'listSent'){
                _showDealBtns(summaryBO.pageConfig.canDeal && summaryBO.formIsLock !== true, ["canFavorite"]);
            }
            
        }
    }else{
        //从我的收藏过来且当前文件是收藏的情况显示取消收藏
        if (summaryBO.openFrom == 'docLib' && summaryBO.isFavorite == true) {
        	 _showDealBtns(summaryBO.pageConfig.canDeal && summaryBO.formIsLock !== true, ["canFavorite"]);
        }else {
        	//把所有按钮干掉
        	_$("#footer_btns").remove();
        }
    }
    
    //轮循加锁机制
    if (summaryBO.pageConfig.canDeal && summaryBO.formIsLock !== true) {
        pageX.lockFormInt = setInterval("updateLockTime()", 180*1000);
    }
    
    _initDetailWfDesigner();
   
}

/**
 * 初始化流程编辑
 */
function _initDetailWfDesigner(){
	//加载流程数据
    // LazyUtil.addLoadedFn("lazy_wf", function(){
        // _initWfDesigner(null, {
            // model : "silent",//采用静默模式
            // useTemplateId : false,
            // onTriggerEdit : function(){
                // var c = _$("#workflow_dot_btn");
                // if(c && c.classList.contains("display_none"))
                    // c.classList.remove("display_none");
                // pageX.editWorkflow = true;
            // }
        // });
    // });
}

/**
 * 更新锁时间
 */
function updateLockTime(){

    
    var formRecordId ="";
    if(summaryBO["summary"].bodyType == '20' && summaryBO.pageConfig.canDeal){
        formRecordId = summaryBO["summary"].formRecordId;
    }
    processId = summaryBO["summary"].processId;
    
    $s.Coll.updateLockTime({"formRecordId":formRecordId,"processId":processId},errorBuilder({
        error : function(){
            clearInterval(pageX.lockFormInt);
        },
        exeSelfError : true
    }));
    
}

//处理协同
function _dealSummary(){
    
    //表单校验判断
    if(!pageX.isMoreComment && summaryBO["summary"].bodyType == "20"){
        if(cmp.sui.isPreventSubmit()){
            //表单失去焦点校验失败,阻止跳转
            return;
        }
    }
    if(_summaryRepeatClk){
        return;
    }
    _summaryRepeatClk = true;
    var pageParams = {
        "cache_subfix" : pageX.winParams.cache_subfix,
        "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
        "action" : WorkFlowLock.SUBMIT//提交操作
    }
    summaryBO.backIndex = summaryBO.backIndex + 1;
    _cacheSignet(false);
    cmp.event.trigger("beforepageredirect", document);
    cmp.href.next(_collPath + "/html/details/comment.html"+colBuildVersion, pageParams, {openWebview : true});
}

//回退
function _returnSummary() {
    //协同流程回退加锁
    var _sbCall = function(){
        WorkFlowDesignerUtil.lockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.STEP_BACK, function(ret) {
            if(ret) {
                
                var nextPageData = {
                        "cache_subfix" : pageX.winParams.cache_subfix,
                        "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
                        "title" : cmp.i18n("collaboration.page.lable.button.return"),//回退
                        "placeholder" : cmp.i18n("collaboration.page.info.whencancel", [cmp.i18n("collaboration.page.lable.button.return")]),//回退流程不可恢复，若确认回退流程，请在这里输入回退附言。
                        "action" : WorkFlowLock.STEP_BACK
                }
                summaryBO.backIndex = summaryBO.backIndex + 1;
                cmp.event.trigger("beforepageredirect", document);
                cmp.href.next(_collPath + "/html/details/comment.html"+colBuildVersion, nextPageData, {openWebview : true});
            }
        });
    }
    var params = {"affairId":summaryBO["summary"].affairId};
    $s.EdocResource.transStepBackValid({},params, errorBuilder({
        success : function(result) {
            if(result["error_msg"]){
                _alert(result["error_msg"]);
                return;
            }else {
                _sbCall();
            }
        }
    }));
    
}

//处理人撤销
function _repealSummary(){
    //协同流程撤销加锁
    var repelaCall = function(){
        WorkFlowDesignerUtil.lockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.REPEAL_ITEM, function(ret) {
            if(ret) {

                var nextPageData = {
                    "action" : WorkFlowLock.REPEAL_ITEM,
                    "cache_subfix" : pageX.winParams.cache_subfix,
                    "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
                    "title" : cmp.i18n("collaboration.page.lable.button.cancel1"),//撤销
                    "placeholder" : cmp.i18n("collaboration.page.info.whencancel", [cmp.i18n("collaboration.page.lable.button.cancel1")])//撤销流程不可恢复, 若确认撤销流程, 请在这里输入撤销附言。
                }
                summaryBO.backIndex = summaryBO.backIndex + 1;
                cmp.event.trigger("beforepageredirect", document);
                cmp.href.next(_collPath + "/html/details/comment.html"+colBuildVersion, nextPageData, {openWebview : true});
            }
        });
    }
    var params = {"summaryId":summaryBO["summary"].id,"affairId":summaryBO["summary"].affairId};
     // 撤销公文
    $s.EdocResource.transRepalValid({},params,errorBuilder({
      success : function(result) {
          if(result.error_msg || result["error_msg"]){
              _alert(result.error_msg || result["error_msg"],null,"");
              return;
          }else {
            repelaCall();
          }
      }
    }));
}

//指定回退
function _specifiesReturn(){
    
    pageX.wfDesigner.specifiesReturn(function(returnInfo, submitStyleName){
        
        var pageParams = {
                "cache_subfix" : pageX.winParams.cache_subfix,
                "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
                "action" : WorkFlowLock.SPECIFIES_RETURN,//提交操作
                "title" : submitStyleName,//回退
                "placeholder" : cmp.i18n("collaboration.page.info.whencancel", [cmp.i18n("collaboration.page.lable.button.return")]),//回退流程不可恢复，若确认回退流程，请在这里输入回退附言。
                "returnInfo" : returnInfo
            }
        summaryBO.backIndex = summaryBO.backIndex + 1;
        cmp.event.trigger("beforepageredirect", document);
        cmp.href.next(_collPath + "/html/details/comment.html"+colBuildVersion, pageParams, {openWebview : true});
    });
}


//终止
function _terminateSummary() {
    //协同流程终止加锁
    WorkFlowDesignerUtil.lockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.STEP_STOP, function(ret) {
        if(ret) {
            _formLoadCheck({
                checkCallback : function(ret){
                    if(ret == true){
                         if(_summaryRepeatClk){
        					  return;
    					 }
    					_summaryRepeatClk = true;
                        var nextPageData = {
                            "action" : WorkFlowLock.STEP_STOP,
                            "cache_subfix" : pageX.winParams.cache_subfix,
                            "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
                            "title" : cmp.i18n("collaboration.page.lable.button.terminate"),//终止
                            "placeholder" : cmp.i18n("collaboration.page.info.whencancel",[cmp.i18n("collaboration.page.lable.button.terminate")])//终止流程不可恢复，若确认回退流程，请在这里输入终止附言。
                        }
                        summaryBO.backIndex = summaryBO.backIndex + 1;
                        cmp.event.trigger("beforepageredirect",document);
                        cmp.href.next(_collPath + "/html/details/comment.html"+colBuildVersion, nextPageData, {openWebview : true});
                    }
                }
            });
        }
    });
}
var isFavoriteOrCancelSuccess = true;
function switchFavoriteName(btnName){
	if(btnName instanceof Array){
		for(var i = 0 ; i < btnName.length ; i++){
			var temp = btnName[i];
			if(temp.key == "FavoriteKey"){
				var temName = temp.name;
				temp.name = temp.name2;
				temp.name2 = temName;
				isFavoriteOrCancelSuccess = true;
			}
		}
	}
}
var hasFavorite="";
function _favoriteSummary(btnObj){
	isFavoriteOrCancelSuccess = false;
	var affairId = summaryBO.summary.affairId;
	var paramData = {"affairId" : affairId,"from":""};
	if(hasFavorite == "1"){
		 $s.EdocResource.cancelFavoriteAffair(paramData, errorBuilder({
				success : function(result) {
					if (result.success == "true") {
						//reloadPage();
						hasFavorite = "0";
						summaryBO.summary.hasFavorite = "0";
						switchFavoriteName(btnObj);
                        cmp.notification.alert(cmp.i18n("collaboration.favorite.cancelSuccess"), null, "", cmp.i18n("collaboration.page.dialog.OK"));
					} else {
						cmp.dialog.failure(result.message, null, "", cmp.i18n("collaboration.page.dialog.OK"));
					}
				}
	    }));
	}else{
		 $s.EdocResource.favoriteAffair(paramData, errorBuilder({
			success : function(result) {
				if (result.success == "true") {
					hasFavorite = "1";
					summaryBO.summary.hasFavorite = "1";
					switchFavoriteName(btnObj);
                    cmp.notification.alert(cmp.i18n("collaboration.favorite.success"), null, "", cmp.i18n("collaboration.page.dialog.OK"));
				} else {
					cmp.dialog.failure(cmp.i18n("collaboration.takeBackErr.msg11"), null, "", cmp.i18n("collaboration.page.dialog.OK"));
				}
			}
		}));
	}
}


//已办、在办、已发流程结束、未结束、我的收藏的收藏接口调用
function canFavoriteBtn() {
    var affairId = summaryBO.summary.affairId;
    var paramData = {"affairId" : affairId,"from":""};
    if(hasFavorite == "1"){
    	 $s.EdocResource.cancelFavoriteAffair(paramData, errorBuilder({
    			success : function(result) {
    				if (result.success == "true") {
    					//reloadPage();
    					hasFavorite = "0";
    					summaryBO.summary.hasFavorite = "0";
    					
    					var label=_$("#canFavoriteBtnLable"); 
    					label.innerText="收藏"; 
    					//cmp.notification.toast("取消成功","top","",0);
    					
    				} else {
    					cmp.dialog.failure(result.message);
    				}
    			}
        }));
    }else{
    	 $s.EdocResource.favoriteAffair(paramData, errorBuilder({
    		success : function(result) {
    			if (result.success == "true") {
    				hasFavorite = "1";
    				summaryBO.summary.hasFavorite = "1";
    				
    				var label=_$("#canFavoriteBtnLable"); 
    				label.innerText="取消收藏"; 
    				//cmp.notification.toast("收藏成功","top","",0);
    			} else {
    				cmp.dialog.failure(cmp.i18n("collaboration.takeBackErr.msg11"));
    			}
    		}
    	}));
    }
}

//移交
function _transferSummary() {
    //协同流程终止加锁
    WorkFlowDesignerUtil.lockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.TRANSFER, function(ret) {
        if(ret) {
            _formLoadCheck({
                checkCallback : function(ret){
                    if(ret == true){
                        if(_summaryRepeatClk){
                            return;
                        }
                        _summaryRepeatClk = true;
                        var nextPageData = {
                            "action" : WorkFlowLock.TRANSFER,
                            "cache_subfix" : pageX.winParams.cache_subfix,
                            "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
                            "title" : cmp.i18n("collaboration.page.lable.button.transfer")
                            //"placeholder" : cmp.i18n("collaboration.page.info.whencancel",[cmp.i18n("collaboration.page.lable.button.terminate")])//终止流程不可恢复，若确认回退流程，请在这里输入终止附言。
                        }
                        summaryBO.backIndex = summaryBO.backIndex + 1;
                        cmp.event.trigger("beforepageredirect",document);
                        cmp.href.next(_collPath + "/html/details/comment.html"+colBuildVersion, nextPageData, {openWebview : true});
                    }
                }
            });
        }
    });
}


//撤销
function _transRepal(){
    //协同流程撤销加锁
    WorkFlowDesignerUtil.lockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.REPEAL_ITEM, function(ret) {
        if(ret) {
            var nextPageData = {
                    "cache_subfix" : pageX.winParams.cache_subfix,
                    "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
            };
            
            summaryBO.backIndex = summaryBO.backIndex + 1;
            
            cmp.event.trigger("beforepageredirect",document);
            cmp.href.next(_collPath + "/html/cancel.html"+colBuildVersion, nextPageData, {openWebview : true});
        }
    });    
}

//支持原样表单，多一层验证
function _dealSummaryCheck(){
	_formLoadCheck({
		checkCallback : function(ret){
			if(ret == true){
				_dealSummary();
			}
		}
	});
}

//原表单预提交处理
var _violenceClickFlag = false;
function _formLoadCheck(xParams){
    
    if(_violenceClickFlag){
        //暴力点击
        return;
    }
    
    _violenceClickFlag = true;
    
    var checkCallback;
    
    checkCallback = function(ckRet){
        xParams.checkCallback(ckRet);
        _violenceClickFlag = false;
    }
    
    //意见更多处理
    if(pageX.isMoreComment){
        checkCallback(true);
        return;
    }
    
    if(summaryBO["summary"].bodyType == '20' && !_isContentInit){
        _alert(cmp.i18n("collaboration.action.alert.contentinit"));
        checkCallback(false);
        return;
    }
    
    //直接提交
    checkCallback(true);
}


function _transRepalValid(){
    var params = {"summaryId":summaryBO["summary"].id,"affairId":summaryBO["summary"].affairId};
     // 撤销公文
    $s.EdocResource.transRepalValid({},params,errorBuilder({
        success : function(result) {
            if(result["msg"]){
                _alert(result["msg"],null,"");
            }else if(result.error_msg || result["error_msg"]){
                _alert(result.error_msg || result["error_msg"],null,"");
                return;
            }else {
                _transRepal();
            }
        }
    }));
}


//跟踪切换
function _taggleTrack(){
    var trackBtn = _$("#trackBtn");
    var trackFlag = trackBtn.getAttribute("trackFlag");
    var trackLable = _$("#trackBtnLable");
    var trackImg = _$("#trackBtnImg");
    if(trackFlag == "1"){
        trackBtn.setAttribute("trackFlag", "0");
        trackImg.className="see-icon-v5-common-tracking";
        trackLable.innerText = cmp.i18n("collaboration.page.lable.button.track");//跟踪
    }else{
        trackBtn.setAttribute("trackFlag", "1");
        trackImg.className="see-icon-v5-common-tracking-cancel";
        trackLable.innerText = cmp.i18n("collaboration.page.lable.button.track_cancel");//取消跟踪
    }
}

function transForward() {
	
	var page = {
            "summaryId" : summaryBO["summary"].id,
            "affairId" : summaryBO["summary"].affairId,
            "defPolicy" : summaryBO["defPolicy"],
            'accountId':summaryBO["summary"].accountId,
            "cache_subfix" : pageX.winParams.cache_subfix,
            "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
            //"backIndex" : summaryBO.backIndex + 1,
            "parentX":{
                "openFrom": "summary"
            }
    };
	
	if(summaryBO && summaryBO.openFrom =="listWaitSend"
		&& summaryBO["summary"].templateId){
		
	    var templateId = summaryBO["summary"].templateId;
    	$s.Coll.isTemplateDeleted({
            "templateIds" : templateId
        }, errorBuilder({
            success : function(result) {

                if (result && result.code == "0") {

                    var delTemplateIds = result["data"]["delTemplateIds"];
                    if (delTemplateIds.length > 0) {

                        _alert(cmp.i18n('collaboration.forword.errorTemplate',[summaryBO["summary"]["subject"]]));
                        forwardCount = 0;
                        return;
                    }

                    // 待发的时候转发协同该属性引起报错 跳转回来的时候重新加载页面加载上该属性。
                    cmp.event.trigger("beforepageredirect", document);
                    cmp.href.next(_collPath + "/html/colForward.html" + colBuildVersion, page, {
                        openWebview : true
                    });
                }
                else {
                    _alert(result.message);
                    return;
                }
            },

            error : function(result) {
                _alert(result.message);
                return;
            }
        }));
	}else{
		//待发的时候转发协同该属性引起报错 跳转回来的时候重新加载页面加载上该属性。
		cmp.event.trigger("beforepageredirect",document);
		cmp.href.next(_collPath + "/html/colForward.html"+colBuildVersion,page, {openWebview : true});
	}
    

}

/**
 * 协同取回公用方法
 * @param workitemId 
 * @param processId
 * @param activityId
 * @param performer
 * @param caseId
 * @param appName
 * @param isForm
 * @param affairId 
 * @param trackBackCall 
 */
function trackBack(workitemId, processId, activityId, performer, caseId, appName, isForm,affairId,trackBackCall){
    var trackBackParam = {};
    trackBackParam.affairId = affairId;
    
    //调用工作流的是否能取回方法
    canTakeBack(workitemId, processId, activityId, null, caseId, appName, isForm,function(msg){
        //判断是否能够取回
        if (msg!=null && !msg.canTakeBack) {
            var msg = 'collaboration.takeBackErr.msg'+msg.state;
            clickCount = false;
            _alert(cmp.i18n(msg),null,cmp.i18n("collaboration.page.dialog.note"),[cmp.i18n("collaboration.button.close.label")]);
            return;
        }else{
            //协同流程取回加锁
            WorkFlowDesignerUtil.lockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.TAKE_BACK, function(ret) {
                if(ret) {
                	var workflowCheckParam = {
              			event : "BeforeTakeBack",
              			callback : function(flag){
              				if(flag){
              					var updateComment = cmp.i18n("collaboration.page.lable.updateComment");
              					var notUpdateComment = cmp.i18n("collaboration.page.lable.notUpdateComment");
              					var items=[updateComment,
              					           notUpdateComment,
              					           cmp.i18n("collaboration.page.cancelFavorite"),
              					           cmp.i18n("collaboration.page.lable.sureUpdateComment")]; 
              					cmp.notification.judge(items[3],function(index){
              						if (index != 2) {
              							if (index == 0) {//修改原意见
              								trackBackParam.isSaveOpinion = false;
              							} else if (index == 1) {//重新处理
              								trackBackParam.isSaveOpinion = true;
              							}
              							//dee表单开发高级
              							var deeSuccessFn = function(){
              								$s.EdocResource.newTakeBack(trackBackParam,errorBuilder({
              									success : function(result) {
              										if (result.message != "null") {
              											_alert(result.message);
              										}
              										if(typeof(trackBackCall)=='function'){
              											trackBackCall();
              										}
              									}
              								}));
              							}
              						//表单开发高级
              	   					formDevelopAdance4ThirdParty(summaryBO["summary"].bodyType,summaryBO["summary"].affairId,"takeback","",null,deeSuccessFn);
              						} else {
              							clickCount = false;
              							WorkFlowDesignerUtil.unLockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.TAKE_BACK);
              						}
              					},cmp.i18n("collaboration.page.lable.button.tackback"),[items[0],items[1],items[2]],null,2); 
              				}else{
              					clickCount = false;
              					WorkFlowDesignerUtil.unLockH5Workflow(summaryBO["summary"].processId, WorkFlowLock.TAKE_BACK);
              				}
              			},
                        formAppId : summaryBO.workflowCheckParam.formAppId,
                        formId : summaryBO.workflowCheckParam.formId,
                        formOperationId : summaryBO.workflowCheckParam.formOperationId
                    };
                	pageX.wfDesigner.executeWorkflowBeforeEvent(workflowCheckParam);
                }else{
                	clickCount = false;
                }
            });
        }
    });
}
var btns = [];
var clickCount = false;//防止重复点击
//处理按钮设置 TODO 本期改造点
function _showDealBtns(canDeal, nodeActions){
    
    //页面显示
    var footerBar = _$("#footer_btns");
    var affairSubState = summaryBO["summary"].affairSubState;
    var summaryState = summaryBO["summary"].state;
    if(canDeal){
        
        _$("#otherBtns").remove();
        _$("#deal_summary_btn").addEventListener("tap", _dealSummaryCheck);
        
        
        function initMorBtns(hasSign){
            
            var actionI18n = {
                    "Forward" : cmp.i18n("collaboration.page.lable.button.forward"),//转发协同
                    "Return" : cmp.i18n("collaboration.page.lable.button.return"),//回退
                    "Terminate" : cmp.i18n("collaboration.page.lable.button.terminate"),//终止
                    "Cancel" : cmp.i18n("collaboration.page.lable.button.cancel1"),//撤销
                    "SpecifiesReturn" : cmp.i18n("collaboration.default.stepBack"),// 指定回退
                    "Transfer" : cmp.i18n("collaboration.page.lable.button.transfer"),// 移交
                    "Edit" : cmp.i18n("collaboration.page.lable.button.modifyContent")//修改正文
                }

            if(!summaryBO.isHaveNewColl){
                delete actionI18n["Forward"];
            }
            
            //只有office格式的正文才能修改正文且只有CMP壳才能修改正文
            if(!summaryBO.content 
                    || !summaryBO.canEditContent
                    || summaryBO.content.contentType=="20" 
                    || !summaryBO.content.fileId 
                    || !CollUtils.isCMPShell() 
                    || !cmp.os.android){
            	delete actionI18n["Edit"];
            }
            
          //非当前指定回退状态，整个流程处于指定回退状态
            if(summaryBO.inInSpecialSB){
                delete actionI18n["SpecifiesReturn"];
                delete actionI18n["Return"];
            }else if(affairSubState == '15'){
                
                delete actionI18n["Transfer"];
                delete actionI18n["Return"];
                delete actionI18n["SpecifiesReturn"];
                
            }else if(affairSubState == '16'){
                
                delete actionI18n["Transfer"];
                delete actionI18n["Return"];
                
            }else if(affairSubState == '17'){
                
                delete actionI18n["Transfer"];
                delete actionI18n["Return"];
                delete actionI18n["SpecifiesReturn"];
            }
            
            if(actionI18n["SpecifiesReturn"]){
              //尝试初始化流程
                _initDetailWfDesigner();
            }
            
            for(var i = 0, len = summaryBO.pageConfig.commonActions.length; i < len; i++){
                var action = summaryBO.pageConfig.commonActions[i];
                if(actionI18n[action]){
                    btns.push({
                        key : action,
                        name : actionI18n[action]
                    });
                }
            }
          
          //顺序
          if(hasSign){
            btns.push({
                key : "Sign",
                name : cmp.i18n("collaboration.page.lable.button.signature")//签章
            });
           }
          //收藏 addby lib
           if(summaryBO.pageConfig.canFavorite){
        	   hasFavorite = summaryBO.summary.hasFavorite;
        	   if(hasFavorite == '1' && summaryBO.isFavorite){
        		   var labelName1 = cmp.i18n("collaboration.page.cancelfavorite2");
            	   var labelName2= cmp.i18n("collaboration.page.favorite");
            	   hasFavorite = "1";
        	   }else{
        		   var labelName1 = cmp.i18n("collaboration.page.favorite");
            	   var labelName2= cmp.i18n("collaboration.page.cancelfavorite2");
            	   hasFavorite = "0";
        	   }
        	   
        	   btns.push({
                   key : "FavoriteKey",
                   name : labelName1,
                   name2 : labelName2
               });
           }
           //电话会议
           if(summaryBO.showMeetingBtn){
        	   btns.push({
        		   key : "Meeting",
        		   name : cmp.i18n("collaboration.page.lable.button.meeting")
        	   });
           }
           var dMoreBtn = _$("#deal_more_btn");
           if(dMoreBtn){
               if(btns.length > 0){
                   cmp.event.click(dMoreBtn,function(e) {
                	   if(isFavoriteOrCancelSuccess){//收藏和取消收藏切换时，按钮显示有延迟
                		   cmp.dialog.actionSheet(btns, cmp.i18n("collaboration.page.lable.button.cancel"), function(item) {
                			   //点击操作
                			   switch (item.key) {
                			   case "Forward":
                				    exeSubmitData("actionForward");
                				   break;
                			   case "Return":
									if(exchangeSendNotSupportSub()){//如果是发文的交换流程不支持
										cmp.notification.toast(cmp.i18n("collaboration.return.notSsupport"));
										return;
									}
                				    exeSubmitData("actionReturnSummary");
                				   break;
                			   case "Terminate":
                				  exeSubmitData("actionTerminateSummary");
                				   break;
                			   case "Sign":
                				   //如果当前页签不是正文页签切换到正文页签
                				   if(summaryBO["summary"].bodyType == "20"){
                					   //切换到表单页签
                					   _switche2View(pageX.cache.formIndex, false);
                				   }
                				   showSignatureButton(summaryBO.hasKeySn, summaryBO["summary"].id);
                				   break;
                			   case "Cancel":
                				    exeSubmitData("actionRepealSummary");
                				   break;
                			   case "SpecifiesReturn":
									if(exchangeSendNotSupportSub()){//如果是发文的交换流程不支持
										cmp.notification.toast(cmp.i18n("collaboration.return.notSsupport"));
										return;
									}
                				    exeSubmitData("actionSpecifiesReturn");
                				   break;
                			   case "Transfer":
                				   exeSubmitData("actionTransferSummary");
                				   break;
                			   case "FavoriteKey":
                				   _favoriteSummary(btns);
                				   break;
                			   case "Edit":
                				  _editContent();
                				   break;
                			   case "Meeting":
                				   _goMeeting();
                				   break;
                			   default:
                				   break;
                			   }
                		   });
                	   }
                   });
                   
               }else{
                   _$("#deal_more_btn").remove();
               }
           }
        }
        
        //先判断签章 TODO 可以优化，等点签章的时候再判断权限
        if((affairSubState != '15' && affairSubState != '17') 
                && !pageX.isMoreComment && CollUtils.isInArray(nodeActions, "Sign") 
                && ((summaryBO["summary"].bodyType == "10" && !summaryBO.content.isForwardForm)
                        || summaryBO["summary"].bodyType == "20")){
            
            LazyUtil.addLoadedFn("lazy_iSignaturePhone", function(){
                if(typeof summaryBO.hasSignFlag == "undefined"){
                    hasSignaturepolicy(function(_keySn){
                        summaryBO.hasSignFlag = false;
                        if(_keySn){
                            summaryBO.hasSignFlag = true;
                            summaryBO.hasKeySn = _keySn;
                        }
                        initMorBtns(summaryBO.hasSignFlag);
                   });
                }else{
                    initMorBtns(summaryBO.hasSignFlag);
                }
            });
        }else{
            initMorBtns(false);
        }
        
        //处理按钮左边，显示编辑流程的图标
        showWorkflowEditButton();
        
        footerBar.style.display = "";
        
    }else{
        _$("#handleBtns").remove();
		if(summaryBO["summary"].affairState != 3){//非待办隐藏处理的时候影藏意见和态度，处理界面移植添加
			_$("#hand_first_line").style.display="none";
			_$("#button_list_nav_new").style.display="none";
		}
        var otherBtn = _$("#otherBtns");
        var otherBtns = [];
		var isAddFavorited = false;//是否已经添加收藏按钮
        //流程未结束，常规的操作按钮
        if(!summaryBO["summary"].finished) {
             
            hasFavorite = summaryBO.summary.hasFavorite;
            var labname = "";
            if(hasFavorite == '1' && summaryBO.isFavorite){
                labname ="collaboration.page.cancelfavorite2";
                hasFavorite = "1";
            }else{
                labname = "collaboration.page.favorite"
                hasFavorite = "0";
            }  
            
            //已办
            if(summaryBO["summary"].affairState == 4){
                if (summaryBO.openFrom != 'docLib') {
                    otherBtns.push({
                        "attrs" : "",
                        "id" : "takeBackBtn",
                        "class" : "see-icon-v5-common-getback",
                        "lable" : cmp.i18n("collaboration.page.lable.button.tackback")//取回
                    });
                }
				
				//(流程未结束的已办) 已办、在办
                if(summaryBO.pageConfig.canFavorite){
				  isAddFavorited = true;
                  otherBtns.push({
                      "attrs" : "",
                      "id" : "canFavoriteBtn",
                      "class" : "see-icon-v5-common-document-official",
                      "lable" : cmp.i18n(labname)//收藏
                  });
				  
                }
                
            } 

            //已发
            else if((summaryBO["summary"].affairState == 2 
                        || (summaryBO["summary"].affairState == 3 
                                && (affairSubState == 15 
                                        || affairSubState == 17))
                    )) {
				//if(CollUtils.isInArray(nodeActions, "Cancel")){
					 otherBtns.push({ //fix jira bug 1589
                    "attrs" : "",
                    "id" : "cancelBtn",
                    "class" : "see-icon-v5-common-rollback",
                    "lable" : cmp.i18n("collaboration.page.lable.button.cancel1")//撤销
					});
				
				//}
               
				//流程未结束的已发
				//if(summaryBO.pageConfig.canFavorite){  
				  isAddFavorited = true;
                  otherBtns.push({
                      "attrs" : "",
                      "id" : "canFavoriteBtn",
                      "class" : "see-icon-v5-common-document-official",
                      "lable" : cmp.i18n(labname)//收藏
                  });
                //}
            } 
            
            //待发
            else if(summaryBO["summary"].affairState == 1) {
                if(summaryBO["summary"].bodyType != '20' && (summaryBO.isHaveNewColl || summaryBO["summary"].templateId)) {
                    //待发-发送
                    otherBtns.push({
                        "attrs" : "",
                        "id" : "sendImmediateBtn",
                        "class" : "see-icon-v5-common-send",
                        "lable" : cmp.i18n("collaboration.page.lable.button.send")//发送
                    });
                }else if(summaryBO["summary"].bodyType=='20') {
                    //待发-编辑
                    otherBtns.push({
                        "attrs" : "",
                        "id" : "editBtn",
                        "class" : "see-icon-v5-common-doc-edit",
                        "lable" : cmp.i18n("collaboration.page.lable.button.edit")//编辑
                    });
                }
            }
        }
        var canfowardColl = summaryBO && summaryBO.summary && summaryBO.summary.canForward != '0';
        if(CollUtils.isInArray(nodeActions, "Forward") && summaryBO.isHaveNewColl && canfowardColl){
            otherBtns.push({
                "attrs" : "",
                "id" : "transformBtn",
                "class" : "see-icon-v5-common-transmit",
                "lable" : cmp.i18n("collaboration.page.lable.button.forward")//转发协同
            });
        }
		
		
        //已办增加收藏功能(流程结束的已办) 流程结束的已发
        if(((summaryBO.pageConfig.canFavorite || summaryBO.openFrom == 'listSent') || (summaryBO.openFrom == 'docLib' && summaryBO.isFavorite == true)) && CollUtils.isInArray(nodeActions, "canFavorite") && !isAddFavorited  ){
           hasFavorite = summaryBO.summary.hasFavorite;
           var labname = "";
           if(hasFavorite == '1' && summaryBO.isFavorite){
              labname ="collaboration.page.cancelfavorite2";
              hasFavorite = "1";
           }else{
              labname = "collaboration.page.favorite"
              hasFavorite = "0";
           }   
        
           otherBtns.push({
               "attrs" : "",
               "id" : "canFavoriteBtn",
               "class" : "see-icon-v5-common-document-official",
               "lable" : cmp.i18n(labname)//收藏
           });
        }
        
        
        //流程未结束，常规的操作按钮
        if(!summaryBO["summary"].finished) {
            if(CollUtils.isInArray(nodeActions, "Track")) {
                if((summaryBO["summary"].listType != "listWaitSend" 
                        && affairSubState != 15 
                        && affairSubState != 17)
                        && summaryState == 0) {
                  //跟踪设置
                    /*var affairTrack = summaryBO["trackProcess"];
                    if(affairTrack == "0" || affairTrack == null){
                        _taggleTrack();
                    }*/
                    
                    //公告审批和新闻审批待办时不能有跟踪按钮
                    var isTrack=cmp.i18n("collaboration.page.lable.button.track_cancel");
                    var trackClass = "see-icon-v5-common-tracking-cancel";
                    var _tf= "trackFlag=\"1\"";
                    if(summaryBO.summary.affairTrack == "0" || summaryBO.summary.affairTrack == null){
                        _tf="trackFlag=\"0\""
                        isTrack=cmp.i18n("collaboration.page.lable.button.track");
                        trackClass = "see-icon-v5-common-tracking";
                    }
                    otherBtns.push({
                        "attrs" : _tf,
                        "id" : "trackBtn",
                        "class" : trackClass,
                        "lable" : isTrack//取消跟踪
                    });
                }
            }
            //列表中不允许终止公文，屏蔽
/*         if(CollUtils.isInArray(nodeActions, "Terminate")) {     
                if(summaryBO["summary"].listType!="listDone" 
                    && (affairSubState != 15 
                            || affairSubState != 17)) {
                    otherBtns.push({
                        "attrs" : "",
                        "id" : "terminateBtn",
                        "class" : "see-icon-v5-common-stop-circle-fill",
                        "lable" : cmp.i18n("collaboration.page.lable.button.terminate")//终止
                    });
                }
            }*/
        }
        
        if(otherBtns.length > 0){
            var otherBtnTemplate = _$("#other_btn_template").innerHTML;
            var btnHTML = cmp.tpl(otherBtnTemplate, otherBtns);
            otherBtn.innerHTML = btnHTML;
            
            //添加事件
            cmp("#otherBtns").on("tap", "a", function(){
                
                var aId = this.getAttribute("id");
                switch (aId) {
                case "takeBackBtn":
                	var idMap = {
                		"summaryID" : summaryBO.summary.id,
                		"affairID" : summaryBO.summary.affairId
                	}
                	//协同已办列表取回前事件
                    var eventParams={
                    	funName : "beforeDoneTakeBack",
                    	data : idMap,
                    	success : function(){
                    		LazyUtil.addLoadedFn("lazy_dee", function(){
                        		//取回
                        		if(!clickCount){
                        			clickCount=true;
                        			var isForm = summaryBO["summary"].bodyType == '20';
                        			trackBack(summaryBO["summary"].affairWorkitemId, summaryBO["summary"].processId, 
                        					summaryBO["summary"].activityId, null, summaryBO["summary"].caseId, 
                        					"collaboration", isForm,summaryBO["summary"].affairId,function(){
                        				//wxj 协同取回后，直接进入该协同的处理页面
                        				var paramData = {
                        						"affairId" : summaryBO["summary"].affairId,
                        						"backIndex" : summaryBO.backIndex + 1
                        				}
                        				setListViewRefresh("true");
										cmp.storage.delete("summary_page_pause", true);
                        				var nextUrl = "/html/details/summary.html"+colBuildVersion;
                        				cmp.href.next(_collPath + nextUrl, paramData);
                        			});
                        		}
        					});
                    	},
                    	error : function(){
                    		
                    	}
                    }
                    cmp.funProxy.getter(eventParams);
                	break;
                case "cancelBtn" :
                    if(summaryBO["summary"].affairState == 2){
                    	var idMap = {
                    		"summaryID" : summaryBO.summary.id,
                    		"affairID" : summaryBO.summary.affairId
                    	}
                    	//协同已发撤销前事件
                        var eventParams={
                        	funName : "beforeDealCancel",
                        	data : idMap,
                        	success : function(){
                        		_transRepalValid();
                        	},
                        	error : function(){
                        		
                        	}
                        }
                        cmp.funProxy.getter(eventParams);
                    }else{
                        //处理时撤销
                        _repealSummary();
                    }
                    break;
                case "sendImmediateBtn":
                    _sendImmediate();
                    break;
                case "editBtn":
                    
                    var paramData = {
                        "summaryId" : summaryBO["summary"].id,
                        "openFrom" : "listWaitSend",//summaryBO.openFrom
                        "backIndex" : summaryBO.backIndex + 1,
                        "preCaches" : CollCacheKey.getCacheKeys(CollCacheKey.summary, pageX.winParams.cache_subfix)
                    }
                    //更多页面编辑，删除表单缓存
                    /*if(pageX.isMoreComment){
                        if(window.summaryBO && summaryBO["summary"].bodyType == "20"){
                            if(cmp.sui){
                                var options = { 
                                        moduleId:summaryBO["summary"].id,
                                        rightId:summaryBO["summary"].rightId,
                                        viewState: summaryBO._viewState
                                }
                                cmp.sui.clearCache(options);
                            }
                        }
                    }*/
                    cmp.href.next(_collPath + "/html/newCollaboration.html"+colBuildVersion, paramData);
                    break;
                case "trackBtn":
                  //跟踪 TODO 好像默认显示的不对
                    $s.Coll.getTrackInfo(summaryBO["summary"].affairId, {},errorBuilder({
                        success : function(result) {
                            if(result && result["error_msg"]){
                                _alert(result["error_msg"]);
                            }else{
                                _taggleTrack();
                            }
                        }
                    }));
                    break;
                case "terminateBtn":
                    _terminateSummary();
                    break;
                case "transformBtn":
                    transForward();
                    break;
				case "canFavoriteBtn": //收藏
                    canFavoriteBtn();
                    break;
                default:
                    break;
                }
            });
            
            footerBar.style.display = "";
        }else{
            footerBar.remove();
        }
    }
}

//处理按钮左边，显示编辑流程的图标
function showWorkflowEditButton() {
    
    var _viewCanEdit = !window.summaryBO.formIsLock && summaryBO.pageConfig.canDeal;
    var subState = window.summaryBO["summary"].affairSubState;
    if (subState != "15" 
        && subState != "16" 
            && subState != "17" 
                && window.summaryBO["summary"].canModify == 'true' 
                    && _viewCanEdit) {
        
        var nodeActions = window.summaryBO.pageConfig.nodeActions;
        if (CollUtils.isInArray(nodeActions, "AddNode") 
                || CollUtils.isInArray(nodeActions, "JointSign") 
                || CollUtils.isInArray(nodeActions, "RemoveNode") 
                || CollUtils.isInArray(nodeActions, "Infom")) {

            // var $workflowbtn = _$("#workflow_btn");
            // if ($workflowbtn) {
                // $workflowbtn.classList.remove("display_none");
                // $workflowbtn.addEventListener("tap", _editWorkflow);
            // }

        }
    }
}

/**
 * 展现流程图
 */
var _summaryRepeatClk = false;

function _editWorkflow(){
    
     _formLoadCheck({
            checkCallback : function(ret){
                if(ret == true){
                    //TODO 如果是非编辑状态下就不需要这个判断了
                    //表单校验判断
                    if(summaryBO.pageConfig.canDeal 
                            && summaryBO["summary"].bodyType == "20"){
                        if(cmp.sui.isPreventSubmit()){
                            //表单失去焦点校验失败,阻止跳转
                            return;
                        }
                    }
                    if(_summaryRepeatClk){
        				return;
    				}
    				_summaryRepeatClk = true;
                    
                    //这里传参要和点击处理一致, 表单有office正文不允许处理
                    var pageParams = {
                        "canEditWorkflow" : true,
                        "action" : WorkFlowLock.SUBMIT,// 提交操作
                        "cache_subfix" : pageX.winParams.cache_subfix,
                        "WebviewEvent" : WebEvents.M3_EVENT_SUMMARY + pageX.winParams.cache_subfix,
                        "edit" : true,
                        "canBack" : false
                    }
                    summaryBO.backIndex = summaryBO.backIndex + 1;
                    cmp.event.trigger("beforepageredirect", document);
                    cmp.href.next(_collPath + "/html/details/workflowEdit.html" + colBuildVersion, pageParams, {openWebview : true});
                }
            }
        });
}

/**
 * 添加流程相关数据
 * 
 * @param param
 * @returns
 */
function _addWorflowData(param) {
    // 删除无用的参数
    delete param["opinionPolicy"];
    delete param["attribute"];
    delete param["nowNodeOpinion"];
    delete param["actions"];
    delete param["filedsIsNull"];
    delete param["actionName"];
    delete param["workflowParam"];
    
    //流程相关参数
    param = cmp.extend(param, pageX.wfDesigner.getDatas());
    return param;
}

var sendCount = 0;
function _sendImmediate() {
	if(sendCount > 0){
		return;
	}
	sendCount++;
	
    //1 开启进度条
    _startSubmitting();
    
    //2 验证流程超期时间是否已过
    var deadlineDatetime = summaryBO["summary"].processDeadLineName;
    if(deadlineDatetime) {
        var nowDatetime = new Date();
        if(deadlineDatetime && (nowDatetime.getTime()+summaryBO.server2LocalTime) > new Date(deadlineDatetime.replace(/-/g,"/")).getTime()){
            _alert(cmp.i18n("collaboration.deadline.sysAlert"), function(){sendCount--;});
            _stopSubmitting();
            return;
        }
    }
    
    //3 验证是否调用模板
    var templateId = null;
    if(summaryBO["summary"].affairSubState != "16") {//指定回退被回退的不再校验模板
        templateId = summaryBO["summary"].templateId;
    }
    if(templateId && templateId!=null && templateId!="") {//有模板
        
        //4 调用模板的状态校验
        $s.Coll.checkCollTemplate({templateId : templateId}, errorBuilder({
            success: function(ret) {
                //4-1 模板删除状态验证
                if(ret.result =='cannot') {
                    _alert(cmp.i18n('collaboration.send.fromSend.templeteDelete'), function(){sendCount--;});//模板已经被删除，或者您已经没有该模板的使用权限三
                    _stopSubmitting();
                    return;
                } 
                //5 是否有流程的验证
                else if(ret.result =='noworkflow') {
                     //协同没有流程,不能发送
                    _alert(cmp.i18n('collaboration.send.fromSend.noWrokFlow'), function(){sendCount--;});
                     _stopSubmitting();
                     return;
                }
                if(ret.result =='isTextTemplate') {
                    if(!summaryBO["summary"].processId) {
                        _alert(cmp.i18n('collaboration.send.fromSend.noWrokFlow'), function(){sendCount--;});
                        _stopSubmitting();
                        return;
                    }
                    _sendImmediateCallback();
                } else {
                    summaryBO["summary"].processId = ret.result;
                    //6 公文发送预提交及提交
                    _sendImmediateCallback();
                }
            }
        }));
    } else {//无模板
        //5 流程的验证
        if(!summaryBO["summary"].processId) {//无模板，有流程
            _alert(cmp.i18n('collaboration.send.fromSend.noWrokFlow'), function(){sendCount--;});
            _stopSubmitting();
            return;
        }
        //TODO 流程id是否为空验证
        //TODO 是否有发起权限验证
        
        //6 公文发送预提交及提交
        _sendImmediateCallback();
    }
}

function _sendImmediateCallback() {
    pageX.wfDesigner.preSubmit({
        contentData : [],
        onPop : function() {
            //组件层级管理，需要把这个影藏
            _stopSubmitting();
        },
        callback : function(preSubmitResult) {
            if(preSubmitResult["result"] == "true") {
                var param = {};
                //处理协同
                $s.Coll.sendImmediate(summaryBO["summary"].affairId, {}, _addWorflowData(param), errorBuilder({
                    success : function(result) {
                        _stopSubmitting();
                        if(result["error_msg"]) {
                            _alert(result["error_msg"], function() {
                                if(window._gotoList){
                                    //意见更多
                                    window._gotoList();
                                }else{
                                    _goBack();
                                }
                            });
                        } else {
                            if(window._gotoList){
                                //意见更多
                                window._gotoList();
                            }else{
                                _goBack();
                            }
                        }
                    }
                }));
            } else {
            	sendCount--;
                _stopSubmitting();
            }
        }
    });
}

function exchangeSendNotSupportSub(){//交换流程不支持回退的校验
	if(summaryBO.summary.exchangeSendAffairId != null && summaryBO.summary.exchangeSendAffairId != '' && summaryBO.summary.govdocType == 'govdocSend'){
		return true;
	}
	return false;
}

//电话会议
function _goMeeting(){
	$s.Coll.multiCall({}, errorBuilder({
        success : function(result) {
        	var obj = result.data.meetingParams;
        	if(obj.meeting_url!=null && obj.meeting_url!=''){
        		obj.openFrom = "openWin";
        		cmp.href.next(_collPath + "/html/multicallPerson_next.html"+colBuildVersion,obj,{nativeBanner:true,openWebViewCatch:1});
        	}else{
        		var options = {
        			title : cmp.i18n("collaboration.meeting.choosePerson"),
        			showAll : false,
        			showState : false,
        			showMeetingInfo : true,
        			callback : function(result){
        				var obj = summaryBO.meetingParams;
        				obj.parties = result;
        				obj.openFrom = "CollSummary";
        				cmp.href.next(_collPath + "/html/multicallPerson_next.html"+colBuildVersion,obj,{nativeBanner:true,openWebViewCatch:1});
        			}
        		};
        		_exeAtWho(options);
        	}
        }
    }));
}

//开始提交
function _startSubmitting(){
    cmp.dialog.loading();
}

//结束提交
function _stopSubmitting(){
	clickCount = false;
    cmp.dialog.loading(false);
}

function _setCommentValue(){
}
